<template>

  <div id="app">

    <div class="warp">
        <div class='left'>
          <div class='left_masking'>
            <menu-temp/>
          </div>
        </div>
        <div class='right'>
            <router-view @openLogin='getopenLogin' @goAnchorData='getGoAnchorData' :goAnchorData='data'/>
        </div> 
    </div>
      <!-- 登录窗口 -->
      <login-temp v-if='loginPageShow' v-on:closeLogin='getCloseLogin'/>
  </div>
</template>

<script>
import menuTemp from './views/left/menu'
import loginTemp from './components/login/loginPage'

export default {
  name: 'home',
  components: {
    menuTemp,
    loginTemp,
  },
  data () {
    return {
      // 登录窗口状态
      loginPageShow: false,
      // 锚点跳转的信息
      data:'',
    }
  },
  methods: {
    // 打开登录窗口
    getopenLogin() {
      this.loginPageShow = true;
    },
    // 关闭登录窗口
    getCloseLogin() {
      this.loginPageShow = false;
    },
    
    getGoAnchorData(str) {
      this.data = str
    }
  }
}
</script>

<style>
* {
  margin: 0;
  padding: 0;
}
ul {
  list-style: none;
}
.left {
  min-width: 300px;
  width: 300px;
  height: 100%;
  position: fixed;
  z-index: 999;
  background: url('./assets/images/bg_img.jpg') no-repeat;
}
.left .left_masking {
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6)
}
.right {
  position: absolute;
  right: 0;
  min-height: 100%;
  left: 300px;
  background: #3f3f3f;
  box-sizing: border-box;
  padding: 15px 30px;
}
</style>
